#coding=utf8

from socket import *

host = 'localhost'
port = 12345
BUF_SIZE = 102400
s_addr = (host,port)

client = socket(AF_INET,SOCK_DGRAM)

while True:
	data = raw_input('>>')
	if not data:
                print '空数据'
	data_len = int(data)
	data = '1'*data_len
	#len = client.sendto(data*1000,s_addr)
	#print 'send data:%s len:%d'%(data,len)
	len = client.sendto(data,s_addr)
	print 'send data:%s len:%d'%(data,len)
	
	#data,addr = client.recvfrom(BUF_SIZE)
	#print(data,addr)
	
client.close()
